# -*- coding: utf-8 -*-

"""
# @Author  : Silva
# @File    : config.py
"""

def get_cookie(cookie_str):
    cookie_str = cookie_str.replace(' ','')
    cookie_dict = {}
    for kv in cookie_str.split(";"):
        k = kv.split('=')[0]
        v = kv.split('=')[1]
        cookie_dict[k] = v
    return cookie_dict

# 手动记录cookie
q_futunn_com_cookie = 'FUTU_TOOL_STAT_UNIQUE_ID=1610260382618742; cipher_device_id=1610260382238222; hasGoneToDownload=1; _gcl_au=1.1.1920186826.1693929972; Hm_lvt_f3ecfeb354419b501942b6f9caf8d0db=1694069416,1694598963; device_id=1610260382238222; _ga=GA1.3.1347631752.1692943257; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%22ftv1tD4ZEEZ52lvW51%2BqsItlsaiACqyV81Q7l2r0PI%2Fl4EHL2lORSwNEFeOUzBdZ5ouI%22%2C%22%24device_id%22%3A%22176eaff8337e04-0549a04904cedd-163b6152-2304000-176eaff8338ceb%22%2C%22props%22%3A%7B%22%24latest_referrer%22%3A%22https%3A%2F%2Fcn.bing.com%2F%22%2C%22%24latest_traffic_source_type%22%3A%22%E8%87%AA%E7%84%B6%E6%90%9C%E7%B4%A2%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC%22%2C%22%24latest_utm_source%22%3A%22alading_user%22%2C%22%24latest_utm_medium%22%3A%22website_growth%22%7D%2C%22first_id%22%3A%22ftv1U7AypczJl%2Feo0y4UlFvdWo7c%2Fzedl%2Bkg2S5kgqMo8TOh7t3JzbR5mBF%2FlA9DxYUs%22%2C%22identities%22%3A%22eyIkaWRlbnRpdHlfbG9naW5faWQiOiJmdHYxdEQ0WkVFWjUybHZXNTErcXNJdGxzYWlBQ3F5VjgxUTdsMnIwUEkvbDRFSEwybE9SU3dORUZlT1V6QmRaNW91SSIsIiRpZGVudGl0eV9jb29raWVfaWQiOiIxOGE2ZTY3ODkxMTQ4OC0wZDk5OGMxZDdmNzkyNy0xOTUyNTYzNC0yMDczNjAwLTE4YTZlNjc4OTEyYzFkIn0%3D%22%2C%22history_login_id%22%3A%7B%22name%22%3A%22%24identity_login_id%22%2C%22value%22%3A%22ftv1tD4ZEEZ52lvW51%2BqsItlsaiACqyV81Q7l2r0PI%2Fl4EHL2lORSwNEFeOUzBdZ5ouI%22%7D%7D; uid=231599125; csrfToken=RnZcH8a60m5SEsMP-mGstZlu; locale=zh-cn; locale.sig=_8-JHymmrgcL5ROK0F6Mu8XEiGiPWj3juJFFOsvEScI; _gid=GA1.2.569540434.1697293265; _clck=1wippnx|2|ffu|0|1343; _uetsid=ea23e8e06a9c11eeb96d413b75b43dee; _uetvid=232dc0e04c0611eeafccbfd500fb00e6; _ga=GA1.1.1347631752.1692943257; _ga_NTZDYESDX1=GS1.2.1697293266.5.1.1697293288.38.0.0; _clsk=1x0qk09|1697293290020|2|1|t.clarity.ms/collect; web_sig=onzW6H%2FiZ78EzRSIVzCGP%2BbHIPJ3UtnEtSVE9i12Q3JuE6YfSdapSaglwd7z1Zrv5YxB%2B%2Bu2nQzwWpcQCQ2Xq1eE%2F4Q%2B5Vk8sr%2F3krEZ5PAS1m4yFXMUZJi5YuFNVMKdXK7XDTr1%2FR1LMo3rLoiEzw%3D%3D; tgw_l7_route=49611328513bc048219dc5db643f7d00; _ga_FZ1PVH4G8R=GS1.1.1697293264.4.1.1697293361.0.0.0; _ga_370Q8HQYD7=GS1.1.1697293361.4.0.1697293361.60.0.0; _ga_K1RSSMGBHL=GS1.1.1697293266.5.1.1697293361.0.0.0; ftreport-jssdk%40session={%22distinctId%22:%22ftv1zhm+3Or+pa/B/7MLP6emXsCUQOk+NiygG0yl3zygCTCcdAySMptZrUcDOt8SBdYg%22%2C%22firstId%22:%22ftv1U7AypczJl/eo0y4UlFvdWo7c/zedl+kg2S5kgqMo8TOh7t3JzbR5mBF/lA9DxYUs%22%2C%22latestReferrer%22:%22https://passport.futunn.com/%22}; _gid=GA1.3.569540434.1697293265; _gat_UA-71722593-3=1; _ga_EJJJZFNPTW=GS1.1.1697293264.15.1.1697293363.0.0.0; _ga_XECT8CPR37=GS1.1.1697293264.15.1.1697293363.0.0.0; PHPSESSID=7p4t6sg7b18jc5vkec1ms251i7; _ga_370Q8HQYD7=GS1.3.1697293361.4.1.1697293363.58.0.0'

# 手动记录cookie
moomoo_com_cookie = 'cipher_device_id=1696034467486612; device_id=1696034467486612; csrfToken=CZfVL3kgVHMfkERJPsztF3TU; data_tracking_global_content=%7B%22promote_id%22%3A13764%2C%22sub_promote_id%22%3A62%7D; _ga_DXBNHXDWEN=GS1.1.1697549352.1.0.1697549357.0.0.0; _ga_ZHE4KJQ4SF=GS1.1.1697549352.1.0.1697549357.55.0.0; news-locale=zh-cn; futu-offline-csrf-v2=%2BtckjHt6IcW%2F0eDrFEjAMQ%3D%3D; _ga_TCL6XGRYQP=deleted; _gcl_au=1.1.1378372570.1696034446.166177781.1697645987.1697647472; _gid=GA1.2.319786155.1698426929; _gat_UA-137699611-5=1; _gat_UA-137699611-6=1; _clck=12wx1ho|2|fg7|0|1368; _gat_gtag_UA_137699611_5=1; tgw_l7_route=eeb833543101a256c422a2afac6452fd; locale=zh-cn; locale.sig=_8-JHymmrgcL5ROK0F6Mu8XEiGiPWj3juJFFOsvEScI; passport_dp_data=bf66139a9de23fea810436982bcb9fde6a4a949579d2535238696702fc3877a17de02061ac03b291f2072ebf81db83952f8009bd993fec40615444d7c3845623977fc4dfefedba63; uid=73239925; web_sig=LK%2BTncDihJmQqmaDviMJ8wa2jVn7HByIP%2FuotS7TsRwz7zpi5cVpHp3PwEbpjQNRGD5uuNNpEkhkroRvwTorHevka4%2BGyijOxSYrIi6NULFI2tBkEQwDkuzTfey0lZFObcUhyzwuGmO6poepYd%2BtDQ%3D%3D; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%22ftv15PI1z1gKA7tD%2BG6WIakAgOHM7Nl06pWPgQurrCUL5azgxR1kQoZKq986291KBxU7%22%2C%22first_id%22%3A%2218ae3883001792-0e7a6a9d2e908a-18525634-2304000-18ae3883002df8%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22identities%22%3A%22eyIkaWRlbnRpdHlfY29va2llX2lkIjoiMThhZTM4ODMwMDE3OTItMGU3YTZhOWQyZTkwOGEtMTg1MjU2MzQtMjMwNDAwMC0xOGFlMzg4MzAwMmRmOCIsIiRpZGVudGl0eV9sb2dpbl9pZCI6ImZ0djE1UEkxejFnS0E3dEQrRzZXSWFrQWdPSE03TmwwNnBXUGdRdXJyQ1VMNWF6Z3hSMWtRb1pLcTk4NjI5MUtCeFU3In0%3D%22%2C%22history_login_id%22%3A%7B%22name%22%3A%22%24identity_login_id%22%2C%22value%22%3A%22ftv15PI1z1gKA7tD%2BG6WIakAgOHM7Nl06pWPgQurrCUL5azgxR1kQoZKq986291KBxU7%22%7D%2C%22%24device_id%22%3A%2218ae3883001792-0e7a6a9d2e908a-18525634-2304000-18ae3883002df8%22%7D; _ga_KER2R4QZ41=GS1.1.1698426928.15.1.1698426971.17.0.0; _ga_TCL6XGRYQP=GS1.1.1698426928.15.1.1698426971.17.0.0; _ga_Q2LPFH9N81=GS1.1.1698426928.15.1.1698426971.0.0.0; _ga=GA1.2.1873448285.1696034447; _ga_76MJLWJGT4=GS1.2.1698426931.12.1.1698426971.20.0.0; _ga_QMQR1WC63N=GS1.2.1698426928.12.1.1698426971.0.0.0; _clsk=hld68|1698426972857|3|1|p.clarity.ms/collect; _ga_25WYRC4KDG=GS1.1.1698426928.16.1.1698426975.0.0.0; _uetsid=6d75434074ec11eea12d8521315c5292; _uetvid=ff3daae05f2911eeb1b5e758143a8ba0; ftreport-jssdk%40session={%22distinctId%22:%22ftv13u51Rg9vYP1+uVGiWO/zPUBrwyfTMTOvv+9RdZBEWDKnxwpjcxXNJBVcgFDbPuS5%22%2C%22firstId%22:%22ftv15PI1z1gKA7tD+G6WIakAgDGkK6aFBY+LtvH5t4GERFPgxR1kQoZKq986291KBxU7%22%2C%22latestReferrer%22:%22https://www.moomoo.com/hans/community/nnq%22}'

COOKIES = {
    'q.futunn.com': get_cookie(q_futunn_com_cookie),
    'www.moomoo.com': get_cookie(moomoo_com_cookie)

}


REQUEST_HEADERS = {
    'q.futunn.com': {
        'Accept': 'application/json, text/plain, */*',
        'Accept-Encoding': 'gzip, deflate, br',
        'Accept-Language': 'zh-CN,zh;q=0.9',
        'Referer': 'https://q.futunn.com/nnq',
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
        'X-Futu-Nnq-New-Website': 'nnq'
    },
    'www.moomoo.com': {
          'Accept': 'application/json, text/plain, */*',
          'Accept-Encoding': 'gzip, deflate, br',
          'Accept-Language': 'zh-CN,zh;q=0.9',
          'Referer': 'https://www.moomoo.com/hans/community/nnq',
          'Sec-Ch-Ua-Platform': '"macOS"',
          'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
          'X-Futu-Nnq-New-Website': 'nnq'
}
}
